package nid.gallery 
{
	import flash.display.DisplayObject;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Rectangle;
	import nid.gallery.view.ui.NextButton;
	import nid.gallery.view.ui.PrevButton;
	
	/**
	 * ...
	 * @author Nidin P Vinayakan
	 */
	public class ThumbHolder extends Sprite 
	{
		[Embed(source='view/ui/images/thumb_next.png')]
		private var ImageSrc:Class;
		
		private var container:Sprite;
		
		public var nextBtn:NextButton
		public var prevBtn:PrevButton
		
		public function ThumbHolder() 
		{
			container = new Sprite();
			
			addEventListener(Event.ADDED_TO_STAGE, configUI);
		}
		
		private function configUI(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, configUI);
			
			container.x = 25;
			addChild(container);
			
			container.scrollRect = new Rectangle(0, 0, stage.stageWidth - 70, 60);
			
			nextBtn = new NextButton(ImageSrc);
			prevBtn = new PrevButton(ImageSrc);
			nextBtn.x = stage.stageWidth - nextBtn.width - 20;
			addChild(nextBtn);
			addChild(prevBtn);
		}
		public function align():void
		{
			container.scrollRect = new Rectangle(0, 0, stage.stageWidth - 70, 60);
			nextBtn.x = stage.stageWidth - nextBtn.width - 20;
		}
		public function addThumb(thumb:DisplayObject):void
		{
			container.addChild(thumb);
		}
		
	}

}